<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>base</title>
<!-- Bootstrap core CSS -->
<link href="../../asserts/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet">
<!--lib js  -->
<script type="text/javascript" src="../../asserts/jquery-1.11.3/jquery.min.js"></script>
<!-- js加载器 -->
<script type="text/javascript" src="../../src/core/jui.config.js"></script>
<script type="text/javascript" src="../../src/loader/loader.js"></script>
<script type="text/javascript" src="gridData.js"></script>

</head>
<body>
<button onclick="hide()">hide()</button>
<button onclick="show()">show()</button>
<button onclick="getData()">getData()</button>
<button onclick="getRows()">getRows()</button>
<hr>
<div id="grid"></div>

<script type="text/javascript">

JUI
.dir('../../src/') // 设置JS存放根目录
.use('Grid',function(){
	grid = new JUI.Grid({
		renderId:'grid'
		,data : gridData
		//,striped:true // 斑马线
		,hover:true // 移动高亮
		,columns : [ [
			{
				field : 'cityName',
				title : '城市'
			},
			{
				field : 'mobile',
				title : '手机号'
			},
			{
				field : 'address',
				title : '地址'
			},
			{
				field : 'createDate',
				title : '创建时间'
			}] 
		]
	});
});

function show(){
	grid.show();
}
function hide(){
	grid.hide();
}
function getData(){
	var data = grid.getData();
	console.log(data)
}
function getRows(){
	var rows = grid.getRows();
	console.log(rows)
}
</script>
</body>
</html>